<%@ page language="java" pageEncoding="ISO-8859-1" import="java.util.*"%>

<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
  <head>
    <html:base />
    
    <title>jaildetail.jsp</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script>
   function checkblank(f)
{
   a=f.jdist.value
   b=f.jty.value
   c=f.jnm.value
   d=f.jed.value
    
    if( (a.match("select")) || (b.match("select")) ||(c.length==0)||(d.length==0))
   {
      alert("pls fill all d fields")
      if(a.match("select"))
      {
         document.getElementById("j").innerHTML="<font color=green>select one option</font>"
      }
      if(b.match("select"))
      {
         document.getElementById("jt").innerHTML="<font color=green> select one option</font>"
      }
      if(c.length==0)
      {
         document.getElementById("jl").innerHTML="<font color=green>Enter jail name </font>"
      }
      if(d.length==0)
      {
         document.getElementById("jj").innerHTML="<font color=green>Enter effect date </font>"
      }
      return false;
    }
  }  
</script>

 <link href="css/style1.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="main-out">
<div class="main">
<div class="page">
<div class="top">
<div class="header">
<div class="header-top">
<%@include file="TopHead.jsp" %>
</div>
<div class="topmenu">
<%@include file="TopMenu.jsp" %>
</div>
<div class="">
<img src="images/d3.gif">
</div>
</div>
<div class="content">
<div class="content-left">
<div class="row1">
<div class="img">&nbsp;</div>
<div class="welcome">
<h1 class="title">Welcome to POlice Seva<span></span></h1>
<p>




</p>

  <html:form action="jaildetl" onsubmit="return checkblank(this)">
  <%  
   ArrayList did=(ArrayList)request.getAttribute("DI");
   ArrayList dn=(ArrayList)request.getAttribute("DN");
   
   ArrayList jid=(ArrayList)request.getAttribute("JDI");
   ArrayList jn=(ArrayList)request.getAttribute("JDN");
	
	Object ob1=request.getAttribute("dj");
	if(ob1!=null)
    {%>
    <p><%=ob1.toString() %> </p>
    
    <%
    }
	
	  
   Object ob=request.getAttribute("spf");
 if(ob!=null)
 {
 
 String ss=ob.toString();
 System.out.println(ss);
 
  %>
    <div align="center">
	<table border="0" width="100%">
		<tr>
			<td colspan="2"><html:select property="jdist">
			
			<%if(ss.equals("pd")){ %>
			<html:option value="select">Select one district </html:option>
			<%}
			else{ %>
			<html:option value="select">Select one Commissionerate </html:option>
			<%}
			
					        if(dn!=null)
					        {
							 for(int i=0;i<dn.size();i++)
		    	             {
		    	             %>
							
							
							<html:option value="<%=did.get(i).toString()%>"> <%=dn.get(i).toString() %></html:option>
							
							<%
							} }
							%>
			</html:select> <br></td>
			<td><label id="j"></label></td>
		</tr>
		<tr>
			<td colspan="2"><html:select property="jty">
			<html:option value="select">Select jail type</html:option>
			<%
			
					        if(jn!=null)
					        {
							 for(int i=0;i<jn.size();i++)
		    	             {
		    	             %>
		    	             <html:option value="<%=jid.get(i).toString()%>"> <%=jn.get(i).toString() %></html:option>
							
							<%
							} }
							%>
		    	             
		    	             
			</html:select><br></td>
			<td><label id="jt"></label></td>
		</tr>
		<tr>
			<td width="24%">Jail Name<br></td>
			<td width="76%"><html:text property="jnm"></html:text> <br></td>
			<td><label id="jl"></label></td>
		</tr>
		<tr>
			<td width="24%">Effect Date<br></td>
			<td width="76%"><html:text property="jed"></html:text> <br></td>
			<td><label id="jj"></label></td>
		</tr>
		<tr>
			
			<td><html:hidden property="uu" value="<%=ob.toString() %>"></html:hidden></td>
		</tr>
		<tr>
			<td colspan="2"><html:submit value="Adddistjail" property="addjails" ></html:submit> <br></td>
		</tr>
	</table>
	
</div>

<%} %> 
</html:form>  
 






</div>
</div>
</div>

</div>
</div>
<div class="bottom">
<!--DO NOT Remove The Footer Links-->
<p><%@include file="Footer.jsp"  %><br>
<!--DO NOT Remove The Footer Links-->
</p>
</div>
</div>
</div>
</div>
</body>
</html:html>
  
  
  
